cmake_minimum_required(VERSION 3.0.0)
project(bfcallocator VERSION 0.1.0)

find_package(CUDA REQUIRED)

set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/third_party)
set(EIGEN_PATH ${THIRD_PARTY}/eigen)

# complier options
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -DOPENGPU -fPIC -O3 -std=c++11 -lpthread -fopenmp -lrt -ldl -pthread")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -fPIC -O3 -fopenmp -std=c99")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --expt-relaxed-constexpr")


include_directories(
    ${PROJECT_SOURCE_DIR}
    ${EIGEN_PATH}
)

include(${CMAKE_CURRENT_LIST_DIR}/bfcallocator/CMakeLists.txt)

AUX_SOURCE_DIRECTORY(${PROJECT_SOURCE_DIR}/ MAIN_SRCS )
cuda_add_executable(bfcallocator ${MAIN_SRCS} ${BFC_OBJECTS})

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
